//import util from '../common/util.js' 
// 定义一个混入对象
var myMixin = {
	data: function() {
		return {
			baseUrl: this.$util.baseUrl,
			imgServer: this.$util.imgServer
		}
	},
	methods: {
		/* 预览照片 */
		previewImage(e, imageList) { //@click="previewImage($event,['https://iode.jpg'])" data-index="0">
			let index = e.currentTarget.dataset.index;
			/* let list = imageList.map((item, index) => {
				return item.url;
			}); */
			uni.previewImage({
				current: imageList[index], // 当前显示图片的http链接   
				urls: imageList //要预览的图片列表
			});
		},
		goTo(e) {
			var url = e.currentTarget.dataset.path;
			url && this.$util.goTo(url);
		},
		toUrl(path) {
			return path&& path.startsWith("http")?path:this.imgServer+path;
		}
	}
}
export default myMixin
